const initialState = {
    arr:[]
}

export default (state = initialState, { type, payload }) => {
    let newobj = JSON.parse(JSON.stringify(state))
  switch (type) {

  case "getlist":
    let newpayload = payload.map((item,index)=>{
        item.name = item.name.replace(item.name, `<span style="color:red">${item.name}</span>`)
        return item
    })
    newobj.arr =newpayload
    return newobj

  default:
    return state
  }
}
